<ol id="dh">
	<li><a href="<?=$public_r[newsurl]?>tribe/detail/?id=<?=$tribe_id?>" class="change">部落首页</a></li>
	<li><a href="<?=$public_r[newsurl]?>tribe/detail/?id=<?=$tribe_id?>&m=subject" >部落讨论</a></li>
	<li><a href="<?=$public_r[newsurl]?>tribe/detail/?id=<?=$tribe_id?>&m=act">部落活动</a></li>
	<li><a href="<?=$public_r[newsurl]?>tribe/detail/?id=<?=$tribe_id?>&m=pho">部落相册</a></li>
</ol><?php
//var_dump($tribe_id);
?>
<div id="GongGao">
			<h3>部落公告</h3>
			<div class="content">
				<p>
					<?=$rs['notice_content']?>
				</p>
				<div style='text-align:right;'><a href="">修改圈子公告</a></div>
			</div>
</div>
<?php 
	$pdb='phome_jat_pic';
	$plt=DbTouchAll($pdb,array('app_type'=>TRIBE_ID_ROOT,'app_id'=>$tribe_id),'*','limit 5');
?>
	<div id="photo">
			<h3><span><a href="<?=$public_r[newsurl]?>tribe/detail/?id=<?=$tribe_id?>&m=pho">查看全部</a></span>部落相册</h3>
			
			<ul>
<?php 
if($plt){
foreach($plt as $ky=>$vl){?>
				<li><a href="<?=$public_r[newsurl]?>tribe/detail/?id=<?=$tribe_id?>&sid=<?=$vl['id']?>&m=s"><img src="<?=$public_r[newsurl].$vl['url']?>" alt="<?=$vl['title']?>" /><span><?=$vl['title']?></span></a></li>
<?php }
			}else{
?>
<div class='no-data'>暂无照片！</div>
<?php }?>			
			</ul>
		  <span class="clear"></span>
		</div>
		<!-- photo结束 -->
<?php
	//$tribe_id
		$subject_db='phome_jat_tribe_subject';
		$p=$_REQUEST['p'];
		$nums=DbTouch($subject_db,array('tribe_id'=>$tribe_id),"count(*) as total");
		$page=new page_obj($p,array("itemnum"=>10,"border"=>4,"row_count"=>$nums['total']));
		$limit_str=$page->get_limit_str();
		$subject_list=DbTouchAll($subject_db,array('tribe_id'=>$tribe_id),'*','order by time desc '.$limit_str);
		$page_list=$page->build_html_link("p");
?>
<div id="Topic">
	<h3><span><a href="#">查看精华</a></span> 部落话题 </h3>
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
	  <tr>
		<th scope="col">话题</th>
		<th scope="col">作者</th>
		<th scope="col">回应</th>
		<th scope="col">最后回应</th>
	  </tr>
	  <?php if($subject_list){
		  foreach($subject_list as $key=>$val){
			  $U=getUserInfo($val['uid']);
		  ?>
	  <tr>
		<td><a href="./?m=ss&id=<?=$val['tribe_id']?>&sid=<?=$val['id']?>"><?=$val['title']?></a></td>
		<td><a href='<?=$public_r[newsurl]?>e/member/sp/?uid=<?=$U['userid']?>'><?=$U['nickname']?></a></td>
		<td><?=$val['reply_num']?></td>
		<td><?=date('m-d H-i-s',$val['last_reply_time'])?></td>
	  </tr>
	 <?php 
		  }	  
		  }else{
			  ?>
	  <tr>
		<td><div class='no-data'>暂时无发表主题！</div></td>
	  </tr>
	 <?php }?>	  
	</table>	
	<div class="page"><?=$page_list?>
	 
	</div>
	
	<p><strong><a href="#">发表话题</a></strong> <span>(只有加入圈子后才能发表话题)</span></p>
	<div><style>
	.ipt_box{width:100%;}
	.big-box{height:120px;}		
	</style>
	<form action='<?=$public_r['newsurl']?>e/o/' method='post' id='pub_subject'/>
	<input type='hidden' name='enews' value='add_tribe_word' />	
	<input type='hidden' name='tid' value='<?=$tribe_id?>' />
		<table>
			<tr><th>标题：</th><td><input type='input' name='title' class='title ipt_box' /></td></tr>
			<tr><th>内容：</th><td><textarea class='ipt_box big-box content' name='content'></textarea></td></tr>
			<tr><td colspan='2'><input type='submit' class='ok_submit' value='发表话题'/></td></tr>
		</table>
	</form>
	<script>
		$("#pub_subject").submit(function(){
			var title=$(this).find('.title').val();
			var content=$(this).find('.content').val();
			if(!title){
				alert('标题不能为空！');
				$(this).find('.title').focus();
				return false;
			}
			if(title.length<5){
				alert('标题必须为长度不能小于5个字');
				$(this).find('.title').focus();
				return false;
			}
			if(title.length>200){
				alert('标题必须为长度不能大于200个字');
				$(this).find('.title').focus();
				return false;
			}
			if(!content){
				alert('内容不能为空！');
				$(this).find('.content').focus();
				return false;
			}
			if(content.length<20){
				alert('内容长度不能小于20个字！');
				$(this).find('.content').focus();
				return false;
			}
			return true;
		});
	</script>
	</div>
</div>